{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "博士段房价预测案例--特征工程\n",
    "通过数据探索，我们了解了数据集的特点，接下来我们进行特征工程，对原始特征做必要的数据预处理和特征编码，使得变化后的特征符合模型要求"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.导入必要的包 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "# -*- coding:utf-8 -*-\n",
    "import sys\n",
    "#矩阵操作\n",
    "import numpy as np\n",
    "#处理csv文件 SQL数据处理\n",
    "import pandas as pd\n",
    "\n",
    "#画直方图用，对数据结果进行可视化\n",
    "import matplotlib.pyplot as plt\n",
    "#对matplotlib进行一次封装，画图更容易，使用更方便\n",
    "import seaborn as sns\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.波士顿房价预测\n",
    "读入特征工程后的文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CRIM</th>\n",
       "      <th>ZN</th>\n",
       "      <th>INDUS</th>\n",
       "      <th>CHAS</th>\n",
       "      <th>NOX</th>\n",
       "      <th>RM</th>\n",
       "      <th>AGE</th>\n",
       "      <th>DIS</th>\n",
       "      <th>TAX</th>\n",
       "      <th>PTRATIO</th>\n",
       "      <th>...</th>\n",
       "      <th>RAD_2</th>\n",
       "      <th>RAD_3</th>\n",
       "      <th>RAD_4</th>\n",
       "      <th>RAD_5</th>\n",
       "      <th>RAD_6</th>\n",
       "      <th>RAD_7</th>\n",
       "      <th>RAD_8</th>\n",
       "      <th>RAD_24</th>\n",
       "      <th>MEDV</th>\n",
       "      <th>LOGMEDV</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.419782</td>\n",
       "      <td>0.285654</td>\n",
       "      <td>-1.287909</td>\n",
       "      <td>-0.272599</td>\n",
       "      <td>-0.144217</td>\n",
       "      <td>0.413672</td>\n",
       "      <td>-0.120013</td>\n",
       "      <td>0.140214</td>\n",
       "      <td>-0.666608</td>\n",
       "      <td>-1.353192</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>3.218876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.417339</td>\n",
       "      <td>-0.487292</td>\n",
       "      <td>-0.593381</td>\n",
       "      <td>-0.272599</td>\n",
       "      <td>-0.740262</td>\n",
       "      <td>0.194274</td>\n",
       "      <td>0.367166</td>\n",
       "      <td>0.557160</td>\n",
       "      <td>-0.987329</td>\n",
       "      <td>-0.475352</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>21.6</td>\n",
       "      <td>3.117950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.417342</td>\n",
       "      <td>-0.487292</td>\n",
       "      <td>-0.593381</td>\n",
       "      <td>-0.272599</td>\n",
       "      <td>-0.740262</td>\n",
       "      <td>1.282714</td>\n",
       "      <td>-0.265812</td>\n",
       "      <td>0.557160</td>\n",
       "      <td>-0.987329</td>\n",
       "      <td>-0.475352</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>34.7</td>\n",
       "      <td>3.575151</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.416750</td>\n",
       "      <td>-0.487292</td>\n",
       "      <td>-1.306878</td>\n",
       "      <td>-0.272599</td>\n",
       "      <td>-0.835284</td>\n",
       "      <td>1.016303</td>\n",
       "      <td>-0.809889</td>\n",
       "      <td>1.077737</td>\n",
       "      <td>-1.106115</td>\n",
       "      <td>-0.036432</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>33.4</td>\n",
       "      <td>3.538057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.412482</td>\n",
       "      <td>-0.487292</td>\n",
       "      <td>-1.306878</td>\n",
       "      <td>-0.272599</td>\n",
       "      <td>-0.835284</td>\n",
       "      <td>1.228577</td>\n",
       "      <td>-0.511180</td>\n",
       "      <td>1.077737</td>\n",
       "      <td>-1.106115</td>\n",
       "      <td>-0.036432</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>36.2</td>\n",
       "      <td>3.616309</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       CRIM        ZN     INDUS      CHAS       NOX        RM       AGE  \\\n",
       "0 -0.419782  0.285654 -1.287909 -0.272599 -0.144217  0.413672 -0.120013   \n",
       "1 -0.417339 -0.487292 -0.593381 -0.272599 -0.740262  0.194274  0.367166   \n",
       "2 -0.417342 -0.487292 -0.593381 -0.272599 -0.740262  1.282714 -0.265812   \n",
       "3 -0.416750 -0.487292 -1.306878 -0.272599 -0.835284  1.016303 -0.809889   \n",
       "4 -0.412482 -0.487292 -1.306878 -0.272599 -0.835284  1.228577 -0.511180   \n",
       "\n",
       "        DIS       TAX   PTRATIO  ...  RAD_2  RAD_3  RAD_4  RAD_5  RAD_6  \\\n",
       "0  0.140214 -0.666608 -1.353192  ...      0      0      0      0      0   \n",
       "1  0.557160 -0.987329 -0.475352  ...      1      0      0      0      0   \n",
       "2  0.557160 -0.987329 -0.475352  ...      1      0      0      0      0   \n",
       "3  1.077737 -1.106115 -0.036432  ...      0      1      0      0      0   \n",
       "4  1.077737 -1.106115 -0.036432  ...      0      1      0      0      0   \n",
       "\n",
       "   RAD_7  RAD_8  RAD_24  MEDV   LOGMEDV  \n",
       "0      0      0       0  24.0  3.218876  \n",
       "1      0      0       0  21.6  3.117950  \n",
       "2      0      0       0  34.7  3.575151  \n",
       "3      0      0       0  33.4  3.538057  \n",
       "4      0      0       0  36.2  3.616309  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#波士顿房价预测\n",
    "data_path = \"/home/tianyu/software/IDEAProjects/machine_learning/FE_boston_housing.csv\"\n",
    "\n",
    "#读取数据\n",
    "df = pd.read_csv(data_path)\n",
    "#显示前五行，了解每列（特征）的情况\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 506 entries, 0 to 505\n",
      "Data columns (total 23 columns):\n",
      "CRIM       506 non-null float64\n",
      "ZN         506 non-null float64\n",
      "INDUS      506 non-null float64\n",
      "CHAS       506 non-null float64\n",
      "NOX        506 non-null float64\n",
      "RM         506 non-null float64\n",
      "AGE        506 non-null float64\n",
      "DIS        506 non-null float64\n",
      "TAX        506 non-null float64\n",
      "PTRATIO    506 non-null float64\n",
      "B          506 non-null float64\n",
      "LSTAT      506 non-null float64\n",
      "RAD_1      506 non-null int64\n",
      "RAD_2      506 non-null int64\n",
      "RAD_3      506 non-null int64\n",
      "RAD_4      506 non-null int64\n",
      "RAD_5      506 non-null int64\n",
      "RAD_6      506 non-null int64\n",
      "RAD_7      506 non-null int64\n",
      "RAD_8      506 non-null int64\n",
      "RAD_24     506 non-null int64\n",
      "MEDV       506 non-null float64\n",
      "LOGMEDV    506 non-null float64\n",
      "dtypes: float64(14), int64(9)\n",
      "memory usage: 91.0 KB\n"
     ]
    }
   ],
   "source": [
    "#数据的总体信息\n",
    "#一共包含多少个样本点，一共多少列，列的名字，非空数值，数据类型\n",
    "#X 需要是一个数值，方便处理，对字符串的需要进行编码，才能送到数据模型中\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "    3.2 数据分离\n",
    "从特征数据中分离输入特征 X 和标签 y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "#分离数据X和y\n",
    "y = df['MEDV']\n",
    "X = df.drop(['MEDV', 'LOGMEDV'], axis = 1)\n",
    "\n",
    "#特征名称，对后续显示权重系数对应的特征\n",
    "feat_names = X.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "#对数据进行分离，分出训练数据和测试数据\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train_data, X_test_data, y_train_data, y_test_data = train_test_split(X, y, test_size=0.2, random_state=30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>columns</th>\n",
       "      <th>coef</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>RAD_24</td>\n",
       "      <td>4.155386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>RAD_7</td>\n",
       "      <td>3.212922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>RAD_8</td>\n",
       "      <td>2.487054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>RM</td>\n",
       "      <td>2.456106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZN</td>\n",
       "      <td>1.331782</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>RAD_3</td>\n",
       "      <td>0.807168</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>CHAS</td>\n",
       "      <td>0.734163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B</td>\n",
       "      <td>0.690663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>INDUS</td>\n",
       "      <td>0.199674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>AGE</td>\n",
       "      <td>0.185870</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>RAD_5</td>\n",
       "      <td>-0.875766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>CRIM</td>\n",
       "      <td>-0.960815</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>RAD_4</td>\n",
       "      <td>-1.096240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>TAX</td>\n",
       "      <td>-1.790805</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NOX</td>\n",
       "      <td>-2.099530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>PTRATIO</td>\n",
       "      <td>-2.157639</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>RAD_6</td>\n",
       "      <td>-2.318633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>RAD_2</td>\n",
       "      <td>-2.696487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>DIS</td>\n",
       "      <td>-3.608158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>RAD_1</td>\n",
       "      <td>-3.675402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>LSTAT</td>\n",
       "      <td>-4.038995</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    columns      coef\n",
       "20   RAD_24  4.155386\n",
       "18    RAD_7  3.212922\n",
       "19    RAD_8  2.487054\n",
       "5        RM  2.456106\n",
       "1        ZN  1.331782\n",
       "14    RAD_3  0.807168\n",
       "3      CHAS  0.734163\n",
       "10        B  0.690663\n",
       "2     INDUS  0.199674\n",
       "6       AGE  0.185870\n",
       "16    RAD_5 -0.875766\n",
       "0      CRIM -0.960815\n",
       "15    RAD_4 -1.096240\n",
       "8       TAX -1.790805\n",
       "4       NOX -2.099530\n",
       "9   PTRATIO -2.157639\n",
       "17    RAD_6 -2.318633\n",
       "13    RAD_2 -2.696487\n",
       "7       DIS -3.608158\n",
       "12    RAD_1 -3.675402\n",
       "11    LSTAT -4.038995"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 确定模型选择\n",
    "## 尝试缺省参数的线性回归\n",
    "from sklearn.linear_model import LinearRegression\n",
    "#使用默认配置，不添加参数\n",
    "lr = LinearRegression()\n",
    "#训练模型\n",
    "lr.fit(X_train_data, y_train_data)\n",
    "#预测模型\n",
    "y_pred_train_data = lr.predict(X_train_data)\n",
    "y_pred_test_data = lr.predict(X_test_data)\n",
    "\n",
    "# 看看个特征的权重新书，系统的绝对值大小可视化该特征的重要性\n",
    "\n",
    "fs = pd.DataFrame({\"columns\":list(feat_names), \"coef\":list((lr.coef_.T))})\n",
    "fs.sort_values(by=['coef'], ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The r2 score of LinearRegression on train data is 0.7539084379866171\n",
      "The r2 score of LinearRegression on test data is 0.691383467005563\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import r2_score  #评价回归预测模型的性能\n",
    "## 模型评价\n",
    "print(\"The r2 score of LinearRegression on train data is\", r2_score(y_train_data, y_pred_train_data))\n",
    "print(\"The r2 score of LinearRegression on test data is\", r2_score(y_test_data, y_pred_test_data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x7f32e05bbc50>"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeUAAAFsCAYAAADyj6FyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAcbUlEQVR4nO3de5RdZZnn8e9DUiZIgBBIYiBggnKLhCSs4pJBmGiEoAGSXq2ggxKGmwtwhhbGRlCHalocu2HUQdFuGpUgF7koQuOiG02DQVYLXYlpBCISkbRJhxCCQKKAuTzzx9mJlaLuqcp5q+r7WSur9u3s/bxn59Sv3r3f2hWZiSRJqr+d6l2AJEmqMZQlSSqEoSxJUiEMZUmSCmEoS5JUCENZkqRCGMqSiIhjIuKZiFgfEXN34HGfjIgZ7aybEREreuk4D0XEOb2xL6kvGcoa0CLiuYh4X6tlZ0bETzvapp19ZUS8sy/qLMCVwNcyc0Rm/qD1yuo9eq0K7ecj4saIGLG9B83Md2XmQ9u7H2mgMJSlAkTE0DqX8HbgyU62OTkzRwBTgWnAZX1elTTIGMpSCxHxzoj4SUS8EhEvRsTt1fKF1Sb/XvUWT6uWnxsRyyLipYi4NyL2brGvEyLi6WpfX6/2e0617syIeCQivhwRa4GmiHhHRPxLRKytjn1LRIxssb/nIuJTEfF4RPw+Ir4ZEWMj4v6IWBcRP46IPTpoW5u1RsSvgf2Bf6zaNqyj9ygznwf+mVo4b9n3sIi4JiL+IyJWR8TfRcTO1bq9IuK+iHi5OvbDEbFTiza9r5reueqB/y4ingKOaFX/Nlcqqm0/X03vUR1jTfX6+yJifHfOsVQCQ1na1l8DDwB7AOOBrwJk5nHV+inVJd7bI+K9wP8BTgXGAcuB70ItiIC7qPUm9wSeBv5Lq2MdBTwLjAWuAqLa397AIcC+QFOr1/w5cDxwIHAycD9wOTCa2uf5f7bVqI5qzcx3AP9B1R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HP6bWcwU4oJpfD/wr8PXMfLCN3f4VtUvWv6E2EOs7rdZfRG1w28vU7pG3/H3qrwA7U+u1/4za5fP2dHSOpbqKtsdbSOpN1a8ArQBObyeQJMmestRXImJWRIysLhdfTu3+5s/qXJakghnKUt+ZDvya2iXVk6mNXn6tviVJKpmXryVJKoQ9ZUmSCrFDH4K/11575YQJE3bkISVJKsqiRYtezMzRba3boaE8YcIEmpubd+QhJUkqSkS0+7Q6L19LklQIQ1mSpEIYypIkFWKH3lOWJLVtw4YNrFixgtdff73epaiXDB8+nPHjx9PQ0NDl1xjKklSAFStWsOuuuzJhwgRqf7tD/VlmsnbtWlasWMHEiRO7/DovX0tSAV5//XX23HNPA3mAiAj23HPPbl/5MJQlqRAG8sDSk/NpKEuSVAjvKUtSgZqadvz+hgwZwuTJk9m4cSMTJ07kO9/5DiNHjuz2sc455xwuvvhiJk2atM3yG2+8kebmZr72ta91e58AI0aMYP369V3adsaMGVxzzTU0NjZuXdbc3MxNN93Etdde26Pj7wj2lCVJAOy8884sWbKEJ554glGjRnHdddf1aD833HDDmwK5BI2NjX0eyJs2bdqu1xvKkqQ3mT59OitXrtw6f/XVV3PEEUdw2GGHccUVVwDw+9//ntmzZzNlyhQOPfRQbr/9dqDWS93ySOVvf/vbHHjggRx55JE88sgjW/d35plnctddd22dHzFiBADr169n5syZHH744UyePJl77rnnTbWtWrWK4447jqlTp3LooYfy8MMPd6lNDz30ECeddBIATU1NnHXWWcyYMYP9999/m7C++eabOfLII5k6dSof//jHtwbt+eefT2NjI+9617u2vgdQe4T0pZdeyuGHH86dd97ZpVra4+VrSdI2Nm3axIIFCzj77LMBeOCBB3jmmWd47LHHyExOOeUUFi5cyJo1a9h777354Q9/CMArr7yyzX5WrVrFFVdcwaJFi9h99915z3vew7Rp0zo89vDhw7n77rvZbbfdePHFFzn66KM55ZRTthk0deuttzJr1iw+85nPsGnTJv7whz/0qJ2//OUvefDBB1m3bh0HHXQQ559/PsuWLeP222/nkUceoaGhgQsuuIBbbrmFM844g6uuuopRo0axadMmZs6cyeOPP85hhx0GwJ577snixYt7VEdLhrIkCYDXXnuNqVOnsnLlSg455BCOP/54oBbKDzzwwNZAXb9+Pc888wzHHnssl1xyCZdeeiknnXQSxx577Db7e/TRR5kxYwajR9f+INJpp53Gr371qw5ryEwuv/xyFi5cyE477cTKlStZvXo1b3vb27Zuc8QRR3DWWWexYcMG5s6dy9SpU3vU3tmzZzNs2DCGDRvGmDFjWL16NQsWLGDRokUcccQRW9+TMWPGAHDHHXdw/fXXs3HjRlatWsVTTz21NZRPO+20HtXQmpevJUnAn+4pL1++nMzcek85M7nssstYsmQJS5YsYdmyZZx99tkceOCBLF68mMmTJ/PZz36WK6+8ssvHGjp0KJs3bwZg8+bN/PGPfwTglltuYc2aNSxatIglS5YwduzYN/2u73HHHcfChQvZZ599OPPMM7npppt61N5hw4ZtnR4yZAgbN24kM5k3b97Wtj799NM0NTXxm9/8hmuuuYYFCxbw+OOPM3v27G3q2mWXXXpUQ2v2lDXgdHXUam+PbpUGire+9a1ce+21zJ07lwsuuIBZs2bxuc99jtNPP50RI0awcuVKGhoa2LhxI6NGjeKjH/0oI0eO5IYbbthmP0cddRQXXXQRa9euZbfdduPOO+9kypQpQO0+7KJFizj11FO599572bBhA1C7BD5mzBgaGhp48MEHWb78zX/lcPny5YwfP55zzz2XN954g8WLF3PGGWf0SttnzpzJnDlz+OQnP8mYMWN46aWXWLduHa+++iq77LILu+++O6tXr+b+++9nxowZvXLMlgxlSSpQvX9onDZtGocddhi33XYbH/vYx1i6dCnTp08HaoOybr75ZpYtW8anPvUpdtppJxoaGvjGN76xzT7GjRtHU1MT06dPZ+TIkdtcZj733HOZM2cOU6ZM4cQTT9za0zz99NM5+eSTmTx5Mo2NjRx88MFvqu2hhx7i6quvpqGhgREjRrTbU549e/bW505Pnz6dCy+8sNN2T5o0ic9//vOccMIJbN68mYaGBq677jqOPvpopk2bxsEHH8y+++7LMccc07U3spsiMzvfKOI5YB2wCdiYmY0RMQ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bcAMan9KbzVwBfAD4A5gP2A5cGpmFj+Aqp22zKCffU4i4t3Aw8AvqH2PBbic2r3YfnVeOmjLR6jDeenXoSxJ0kAyIC9fS5LUHxnKkiQVwlCWJKkQhrIkSYUwlCVJKoShLElSIQxlSZIK8f8Bqyc/jWv/Q3kAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 504x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#在训练集上观察预测参差的分布，看是否符合模型假设，噪声为0均值的高斯噪声\n",
    "f, ax = plt.subplots(figsize=(7, 5))\n",
    "f.tight_layout()\n",
    "ax.hist(y_train_data - y_pred_train_data, bins = 40, label=\"Residuals Linear\", color='b', alpha=.5)\n",
    "ax.set_title(\"HIstogram of Residuals\")\n",
    "ax.legend(loc=\"best\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAADQCAYAAADcQn7hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2df5QcdZXoP3dmOmQGhUkkYBgIAeEkB4hMllkIRDkSn0Q3/BgBCYiKyG7cJ3tU9AXD2yDJO7hE4wq46rp56soeWAwQHAPojqyJyz44QTJMIkaSt4gh0oDER4YfySSZH/f90VWTnp6q6qqaqu7q6fs5p8901XR9v7enp25/74/vvaKqGIZhpEFDtQUwDGPiYgrGMIzUMAVjGEZqmIIxDCM1TMEYhpEaTdUWIAxHHXWUzpw5s9piGIbhQ09Pz59UdVrp+ZpQMDNnzmTz5s3VFsMwDB9E5AWv82YiGYaRGqZgDMNIDVMwhmGkRk34YAzDqBxdvXlWd+/gpb5+jm1tZunCW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toHbKRgdrSKiPtFWq3PeT5wsYjsBH5EwUy6MyOyAaCqeefnqxSU81kk8NnWq4J5CjjF8eJPAq4E1ldZJi/WA9c4z6+h4PeoClJYqnwfeFZVv1H0q0zIKCLTnJULItJMwT/0LAVFc3k15VPVm1T1OFWdSeF/bYOqXp0F2QBE5HARebv7HLgA+A1JfLbVcipV+wH8BfB/Kdjpf5sBee4FXgYGKNjj11Gw038B/Bfw78DUKsr3Hgp2+q+BLc7jL7IiI/BuoNeR7zfAl53zJwG/Ap4D7gcOq/Ln/D7g4SzJ5six1Xlsc++HJD5b2ypgGEZq1KuJZBhGBTAFYxhGapiCMQwjNUzBGIaRGqZgDMNIDcvkNUYhIm5oEuCdwBCw2zk+S1UPVkGmbuByVX2z0nMb48PC1IYvIrICeEtVv15yXij87wx7Xpjc/BWZx0gPM5GMUIjIyU4tmHsoJGMdLyJ9Rb+/UkS+5zw/RkQeFJHNTo2WeR7j/aWI/FhE/sOpN7LcZ57pIvJiUZbutSLya6fuyz+Hnc+oDmYiGVGYDXxCVTcX7aHx4pvA11R1k7Pz+mHgdI/XneWcPwg85RRieqt4HgB3Q6WInAF8CThXVV8TkakR5zMqjCkYIwq/c2/6Mvw3YFbRTuspItKsqv0lr+tW1T0AItJFYTvCvwXMswBYq6qvAbg/I8xnVBhTMEYU9hY9H6ZQNMllctFzIZxDuNQB6B7vLX1hGcLOZ1QY88EYsXAcr3tE5BQRaQA+XPTrfweudw9EpN1nmAtEpFVEWoBLgMfLTLsBWOyaRkUmUtj5jApjCsYYD18CuoEnKOwAd7kemO84Y38L/JXP9U9RKAGwFbhXVbcETaaqW4GvAY85letWR5zPqDAWpjaqgoj8JXC6qn6+2rIY6WErGMMwUsNWMIZhpIatYAzDSA1TMIZhpIYpGMMwUsMUjGEYqWEKxjCM1Pj/0EUtclcMXikAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 288x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#观察预测值和真值之间的散点图\n",
    "plt.figure(figsize = (4, 3))\n",
    "plt.scatter(y_train_data, y_pred_train_data)\n",
    "#数据已经标准化，三倍标准差即可\n",
    "plt.plot([-3, 3], [-3, 3], '--k')\n",
    "plt.axis('tight')\n",
    "plt.xlabel('True price')\n",
    "plt.ylabel('Predicted Price')\n",
    "plt.tight_layout()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The r2 score of RidgeCV on train data is 0.7537497752485548\n",
      "The r2 score of RidgeCV on test data is 0.697443866035468\n"
     ]
    }
   ],
   "source": [
    "#正则化的线性回归 （L2正则--》岭回归）\n",
    "from sklearn.linear_model import RidgeCV\n",
    "#1. 设置超参数（正则参数）的范围\n",
    "alphas = [0.01, 0.1, 1, 10, 100]\n",
    "#2.生成一个RidgeCV实例\n",
    "ridge = RidgeCV(alphas = alphas, store_cv_values = True)\n",
    "\n",
    "#3. 模型训练\n",
    "ridge.fit(X_train_data, y_train_data)\n",
    "\n",
    "#4. 预测\n",
    "y_pred_train_data_ridge = ridge.predict(X_train_data)\n",
    "y_pred_test_data_ridge = ridge.predict(X_test_data)\n",
    "#评估，使用r2_score评价模型性能\n",
    "print(\"The r2 score of RidgeCV on train data is\", r2_score(y_train_data, y_pred_train_data_ridge))\n",
    "print(\"The r2 score of RidgeCV on test data is\", r2_score(y_test_data, y_pred_test_data_ridge))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4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1fxg8pX2pNj+3S/SEO9Q2/dqXm9lPhtpeZDgUECKXKeiLJ9/d96d72+7eCrSY2dJ0b1tynwJCJEHwBOrfmdlOi4+38WAwPy/oUmGvxced2GBmnwtWe5iEJ7jN7NtBx4C7zOx/DLCdM2b2jaDNz8ysPGHx/Wa2yczeNrM7gvZVZvZLM9safN2W0P6FoAaRlFJAiFzoM0A1MB/4OPB3QTcUnwGqgHnACmBJwjpLgS0Jr//c3RcCNwIfNrMbk2ynFKhz9+uA14CvJSwrcPdFwJcT5h8B7nb3m4AHgX9MaF8H3DH8jypyaTndWZ/IB3A78V5Ne4HDZvYacEsw/xl3jwGHzOzVhHWmA60Jrx8IumAvCJbNI949QqIY8FQw/TiQ2PFa3/QW4qEEUAh808yqgV5gTkL7I8S7PBFJKQWEyOU7R7yPJczsCuCPgVvc/YSZ/UvfskEk9nnTGXzv5f3/o/+FeB9Y84kf+XcktC8JahBJKZ1iErnQL4EHzSw/uC5wJ/FO9X5FfECdPDObSnzYyT57gKuD6XFAO3AyaPfJAbaTR7w3V4CHgNcHqWs80BIcwawgPoxonzlkRm++kmN0BCFyoeeJX1/YTvyv+j9190Nm9ixwF/FuwhuJDxpzMljn34kHxsvuvt3M3gT2Bu1+NcB22oFFZvbfiZ8ienCQuv4JeNbMVgI/Cdbv89GgBpGUUm+uIkNkZmM8PorYJOJHFUuD8BhFvIvspcG1i6G81xl3H5Oiun4B3OvuJ1LxfiJ9dAQhMnQ/MrMyoAj4n+5+CMDdz5nZ14iP/XsgnQUFp8G+rnCQMOgIQkREktJFahERSUoBISIiSSkgREQkKQWEiIgkpYAQEZGk/j9o5HYU+kaA0AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "alphas is: 1.0\n"
     ]
    }
   ],
   "source": [
    "#可视化\n",
    "mse_mean = np.mean(ridge.cv_values_, axis = 0)\n",
    "plt.plot(np.log10(alphas), mse_mean.reshape(len(alphas), 1))\n",
    "\n",
    "plt.xlabel(\"log(alpha)\")\n",
    "plt.ylabel(\"mse\")\n",
    "plt.show()\n",
    "\n",
    "print(\"alphas is:\", ridge.alpha_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>columns</th>\n",
       "      <th>coef_lr</th>\n",
       "      <th>coef_ridge</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>RAD_24</td>\n",
       "      <td>4.155386</td>\n",
       "      <td>3.721747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>RAD_7</td>\n",
       "      <td>3.212922</td>\n",
       "      <td>2.876220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>RAD_8</td>\n",
       "      <td>2.487054</td>\n",
       "      <td>2.360835</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>RM</td>\n",
       "      <td>2.456106</td>\n",
       "      <td>2.494506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZN</td>\n",
       "      <td>1.331782</td>\n",
       "      <td>1.281489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>RAD_3</td>\n",
       "      <td>0.807168</td>\n",
       "      <td>0.883882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>CHAS</td>\n",
       "      <td>0.734163</td>\n",
       "      <td>0.748869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B</td>\n",
       "      <td>0.690663</td>\n",
       "      <td>0.686843</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>INDUS</td>\n",
       "      <td>0.199674</td>\n",
       "      <td>0.140838</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>AGE</td>\n",
       "      <td>0.185870</td>\n",
       "      <td>0.153427</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>RAD_5</td>\n",
       "      <td>-0.875766</td>\n",
       "      <td>-0.807883</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>CRIM</td>\n",
       "      <td>-0.960815</td>\n",
       "      <td>-0.931602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>RAD_4</td>\n",
       "      <td>-1.096240</td>\n",
       "      <td>-1.043557</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>TAX</td>\n",
       "      <td>-1.790805</td>\n",
       "      <td>-1.589700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NOX</td>\n",
       "      <td>-2.099530</td>\n",
       "      <td>-2.028408</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>PTRATIO</td>\n",
       "      <td>-2.157639</td>\n",
       "      <td>-2.118447</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>RAD_6</td>\n",
       "      <td>-2.318633</td>\n",
       "      <td>-2.215220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>RAD_2</td>\n",
       "      <td>-2.696487</td>\n",
       "      <td>-2.395955</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>DIS</td>\n",
       "      <td>-3.608158</td>\n",
       "      <td>-3.539648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>RAD_1</td>\n",
       "      <td>-3.675402</td>\n",
       "      <td>-3.380068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>LSTAT</td>\n",
       "      <td>-4.038995</td>\n",
       "      <td>-4.017102</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    columns   coef_lr  coef_ridge\n",
       "20   RAD_24  4.155386    3.721747\n",
       "18    RAD_7  3.212922    2.876220\n",
       "19    RAD_8  2.487054    2.360835\n",
       "5        RM  2.456106    2.494506\n",
       "1        ZN  1.331782    1.281489\n",
       "14    RAD_3  0.807168    0.883882\n",
       "3      CHAS  0.734163    0.748869\n",
       "10        B  0.690663    0.686843\n",
       "2     INDUS  0.199674    0.140838\n",
       "6       AGE  0.185870    0.153427\n",
       "16    RAD_5 -0.875766   -0.807883\n",
       "0      CRIM -0.960815   -0.931602\n",
       "15    RAD_4 -1.096240   -1.043557\n",
       "8       TAX -1.790805   -1.589700\n",
       "4       NOX -2.099530   -2.028408\n",
       "9   PTRATIO -2.157639   -2.118447\n",
       "17    RAD_6 -2.318633   -2.215220\n",
       "13    RAD_2 -2.696487   -2.395955\n",
       "7       DIS -3.608158   -3.539648\n",
       "12    RAD_1 -3.675402   -3.380068\n",
       "11    LSTAT -4.038995   -4.017102"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 看看个特征的去赞中系统，系统的绝对值大小可视为对该特征的重要性\n",
    "fs = pd.DataFrame({\"columns\":list(feat_names), \"coef_lr\":list((lr.coef_.T)), \"coef_ridge\":list((ridge.coef_.T))})\n",
    "fs.sort_values(by=['coef_lr'],ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The r2 score of LassoCV on train is 0.7537250176099198\n",
      "The r2 score of LassoCV on test is 0.6977915249872964\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/tianyu/.local/lib/python3.7/site-packages/sklearn/model_selection/_split.py:1978: FutureWarning: The default value of cv will change from 3 to 5 in version 0.22. Specify it explicitly to silence this warning.\n",
      "  warnings.warn(CV_WARNING, FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "#正则化的线性回归（L1正则 --》 Lasso）\n",
    "\n",
    "from sklearn.linear_model import LassoCV\n",
    "\n",
    "#生成实例\n",
    "lasso = LassoCV()\n",
    "#训练\n",
    "lasso.fit(X_train_data, y_train_data)\n",
    "#预测\n",
    "y_pred_train_data_lasso = lasso.predict(X_train_data)\n",
    "y_pred_test_data_lasso = lasso.predict(X_test_data)\n",
    "\n",
    "# 评估，使用r2_score评价模型在测试集和训练集上的性能\n",
    "print('The r2 score of LassoCV on train is', r2_score(y_train_data, y_pred_train_data_lasso))\n",
    "print('The r2 score of LassoCV on test is', r2_score(y_test_data, y_pred_test_data_lasso))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEGCAYAAABiq/5QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deZgc9X3n8fd37lOaGc1IGt0SuhACCTTIEMCXjBeDY4iDwbFDZMIGx/EmeLNZh6y9YTfHkxD7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XANnuXpfsbbt7I1BvZtcke9sy8Sn4JSNYwtfM7K3g/gO3B8uzzOyfg3swbDCzn5nZrcHbPsuIK2vN7PedOjEAAAIySURBVF+CgdPeNrP/eYbtdJnZN4J1njOzqhEvf8rMXjezPWZ2XbD+PDN70cw2B4/fGLH+j4MaRMaVgl8yxSeBlcAK4CPA14JL8j8JzAOWAXcAV494zzXAphHzX3H3GuAy4ANmdtko2ykGat39EuBXwH0jXstx99XAl0YsbwCud/crgNuBfxqxfi1w3fnvqsjZZeQgbZKRriUx0mIMOGFmvwKuDJY/5u5x4LiZbRzxnmqgccT8bcHQ1TnBa8uAN0/bThx4JJj+LvCjEa8NT28i8WUDkAt808xWAjFg8Yj1G0gMSyEyrhT8ImfWS2LsGcxsPvBnwJXu3mpm3xl+7RxGjonSHzzHOPV/7z+TGH9oBYm/wPtGrF8Q1CAyrtTUI5niReB2M8sO2t3fT2IQsZdJ3Gwjy8ymAR8c8Z6dwMJgehLQDbQH633sDNvJIjEqJcBngJfOUddkoD74i+MOErcEHLaY9B0tVVKYjvglUzxBov1+G4mj8C+7+3Ez+yGwhsSwx0eAzSTuGgXwNIkvgl+4+zYz2wLsCtZ7+Qzb6QZWm9lXSTTV3H6Ouv4Z+KGZ/R7wTPD+YR8KahAZVxqdUzKemZW4e5eZTSHxV8A1wZdCIYnheK8Jzg2M5Wd1uXvJONX1AnCzu7eOx88TGaYjfhH4qZmVAXnAX7v7cQB37zWz+0jci/VwMgsKmqMeUOhLGHTELyKSYXRyV0Qkwyj4RUQyjIJfRCTDKPhFRDKMgl9EJMP8f66r8b+byksdAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "alpha is: 0.0069932844085880954\n"
     ]
    }
   ],
   "source": [
    "mses = np.mean(lasso.mse_path_, axis = 1)\n",
    "plt.plot(np.log10(lasso.alphas_), mses) \n",
    "#plt.plot(np.log10(lasso.alphas_)*np.ones(3), [0.3, 0.4, 1.0])\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()    \n",
    "            \n",
    "print ('alpha is:', lasso.alpha_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>columns</th>\n",
       "      <th>coef_lr</th>\n",
       "      <th>coef_ridge</th>\n",
       "      <th>coef_lasso</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>RAD_24</td>\n",
       "      <td>4.155386</td>\n",
       "      <td>3.721747</td>\n",
       "      <td>4.577367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>RAD_7</td>\n",
       "      <td>3.212922</td>\n",
       "      <td>2.876220</td>\n",
       "      <td>3.701791</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>RAD_8</td>\n",
       "      <td>2.487054</td>\n",
       "      <td>2.360835</td>\n",
       "      <td>3.141232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>RM</td>\n",
       "      <td>2.456106</td>\n",
       "      <td>2.494506</td>\n",
       "      <td>2.492505</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZN</td>\n",
       "      <td>1.331782</td>\n",
       "      <td>1.281489</td>\n",
       "      <td>1.262882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>RAD_3</td>\n",
       "      <td>0.807168</td>\n",
       "      <td>0.883882</td>\n",
       "      <td>1.640102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>CHAS</td>\n",
       "      <td>0.734163</td>\n",
       "      <td>0.748869</td>\n",
       "      <td>0.747080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B</td>\n",
       "      <td>0.690663</td>\n",
       "      <td>0.686843</td>\n",
       "      <td>0.681839</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>INDUS</td>\n",
       "      <td>0.199674</td>\n",
       "      <td>0.140838</td>\n",
       "      <td>0.096352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>AGE</td>\n",
       "      <td>0.185870</td>\n",
       "      <td>0.153427</td>\n",
       "      <td>0.132963</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>RAD_5</td>\n",
       "      <td>-0.875766</td>\n",
       "      <td>-0.807883</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>CRIM</td>\n",
       "      <td>-0.960815</td>\n",
       "      <td>-0.931602</td>\n",
       "      <td>-0.929047</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>RAD_4</td>\n",
       "      <td>-1.096240</td>\n",
       "      <td>-1.043557</td>\n",
       "      <td>-0.176267</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>TAX</td>\n",
       "      <td>-1.790805</td>\n",
       "      <td>-1.589700</td>\n",
       "      <td>-1.582793</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NOX</td>\n",
       "      <td>-2.099530</td>\n",
       "      <td>-2.028408</td>\n",
       "      <td>-2.005716</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>PTRATIO</td>\n",
       "      <td>-2.157639</td>\n",
       "      <td>-2.118447</td>\n",
       "      <td>-2.124654</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>RAD_6</td>\n",
       "      <td>-2.318633</td>\n",
       "      <td>-2.215220</td>\n",
       "      <td>-1.370253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>RAD_2</td>\n",
       "      <td>-2.696487</td>\n",
       "      <td>-2.395955</td>\n",
       "      <td>-1.524257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>DIS</td>\n",
       "      <td>-3.608158</td>\n",
       "      <td>-3.539648</td>\n",
       "      <td>-3.548809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>RAD_1</td>\n",
       "      <td>-3.675402</td>\n",
       "      <td>-3.380068</td>\n",
       "      <td>-2.586991</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>LSTAT</td>\n",
       "      <td>-4.038995</td>\n",
       "      <td>-4.017102</td>\n",
       "      <td>-4.023894</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    columns   coef_lr  coef_ridge  coef_lasso\n",
       "20   RAD_24  4.155386    3.721747    4.577367\n",
       "18    RAD_7  3.212922    2.876220    3.701791\n",
       "19    RAD_8  2.487054    2.360835    3.141232\n",
       "5        RM  2.456106    2.494506    2.492505\n",
       "1        ZN  1.331782    1.281489    1.262882\n",
       "14    RAD_3  0.807168    0.883882    1.640102\n",
       "3      CHAS  0.734163    0.748869    0.747080\n",
       "10        B  0.690663    0.686843    0.681839\n",
       "2     INDUS  0.199674    0.140838    0.096352\n",
       "6       AGE  0.185870    0.153427    0.132963\n",
       "16    RAD_5 -0.875766   -0.807883    0.000000\n",
       "0      CRIM -0.960815   -0.931602   -0.929047\n",
       "15    RAD_4 -1.096240   -1.043557   -0.176267\n",
       "8       TAX -1.790805   -1.589700   -1.582793\n",
       "4       NOX -2.099530   -2.028408   -2.005716\n",
       "9   PTRATIO -2.157639   -2.118447   -2.124654\n",
       "17    RAD_6 -2.318633   -2.215220   -1.370253\n",
       "13    RAD_2 -2.696487   -2.395955   -1.524257\n",
       "7       DIS -3.608158   -3.539648   -3.548809\n",
       "12    RAD_1 -3.675402   -3.380068   -2.586991\n",
       "11    LSTAT -4.038995   -4.017102   -4.023894"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 看看各特征的权重系数，系数的绝对值大小可视为该特征的重要性\n",
    "fs = pd.DataFrame({\"columns\":list(feat_names), \"coef_lr\":list((lr.coef_.T)), \"coef_ridge\":list((ridge.coef_.T)), \"coef_lasso\":list((lasso.coef_.T))})\n",
    "fs.sort_values(by=['coef_lr'],ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
